package MainTest;

class Player {
    static int PlayerCount = 0;
    private String name;
    public Player (String n){//此构造函数可以看出被构造了几次
        name = n;
        PlayerCount++;
    }
}

class PlayerTestDrive{
    public static void main (String[] args) {
        System.out.println(Player.PlayerCount);
        Player playerone = new Player("Hamburger");
        System.out.println(Player.PlayerCount);
        Player playertwo = new Player("Sandwish");
        System.out.println(Player.PlayerCount);
        Foo1 foo11 = new Foo1();
        Foo2 foo22 = new Foo2();
        //Foo3 foo33 = new Foo3();
    }
}

class Foo1 {
    public static final int FOo = 3213; //理论上常数变量名称要是大写字母
}
class Foo2 {
    public static final int FOO2;
    static{
        FOO2 = (int)Math.random(); //final静态变量必须在声明或静态初始化程序中赋值，randow返回值为双精度浮点数
    }
}
class Foo3 {
    //public static final int FOO3; //未初始化报错
}